/**
 * @file 列表组件
 * @author its-wild(https://gitee.com/its-wild)
 * @date 2022/11/13
 */
import {
  Slider,
  Input,
  Switch,
  Select,
  Link,
  Color
} from '@/components/CustomPage/fields/widget'
import { BasicOption } from './basicops'
import { DataOption } from './dataops'
import liveTrailerComp from '../widget/liveInfo/liveTrailerComp'
import liveListComp from '../widget/liveInfo/liveListComp'
import { imgOption } from './imgops'
import {cellTitleOps} from '@/components/CustomPage/apps/map/cellTitleops'
export default {
  /**
   * 直播预告轮播
   */
  liveTrailerComp() {
    return {
      target: liveTrailerComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '直播预告轮播'
      },
      option: [
        {
          title: '基础配置', fields: [
            ...BasicOption(),
            {
              type: Switch,
              option: {
                label: '背景颜色是否渐变',
                name: 'isLinearGradBg',
                value: false,
                activetext: '是',
                inactivetext: '否'
              }
            },
            { type: Color, option: { label: '背景颜色', name: 'bgcolor', value: '#fff', showalpha: true }},
            // { type: Input, option: { label: '标题渐变颜色', name: 'bgcolorLine', value: 'linear-gradient(#0ce8f8 0%, #c1fafc 100%)' }},
            { type: Color, option: { label: '标题颜色', name: 'titleColor', value: '#333333', showalpha: true }},
            // { type: Color, option: { label: '渐变背景上颜色', name: 'bgcolorT', value: '#fff', showalpha: true }},
            // { type: Color, option: { label: '渐变背景下颜色', name: 'bgcolorB', value: '#fff', showalpha: true }},
            { type: Input, option: { label: '模块名称', name: 'moduleName', value: '直播预约' }},
            { type: Slider, option: { label: '模块名称上间距', name: 'spacingTopB', value: 24, max: 100, step: 1 }},
            { type: Slider, option: { label: '轮播高度', name: 'lunboheight', value: 368, max: 1000, step: 1 }},
            { type: Slider, option: { label: '轮播上间距', name: 'spacingTop', value: 34, max: 100, step: 1 }},
            { type: Slider, option: { label: '轮播下间距', name: 'spacingBottom', value: 24, max: 100, step: 1 }},
            { type: Slider, option: { label: '轮播左右间距', name: 'spacing', value: 24, max: 100, step: 1 }},
            // {
            //   type: Select, option: {
            //     label: '图片填充模式',
            //     name: 'imgType',
            //     list: [
            //       { name: '填充满', value: 'fill' },
            //       { name: '等比', value: 'contain' }
            //     ],
            //     value: 'fill'
            //   }
            // },
            ...imgOption(),
            {
              type: Switch,
              option: {
                label: '是否开启自动轮播',
                name: 'isAutoPlay',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            { type: Input, option: { label: '轮播时间间隔', value: 5, name: 'delayTime' }},
            {
              type: Switch,
              option: {
                label: '是否显示指示器',
                name: 'indicators',
                value: true,
                activetext: '是',
                inactivetext: '否'
              }
            },
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ]
    }
  },
  /**
   * 直播列表组件
   */
  liveListComp() {
    return {
      target: liveListComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '直播列表'
      },
      option: [
        {
          title: '基础配置', fields: [
            ...BasicOption(),
            { type: Slider, option: { label: '左右间距', name: 'spacing', value: 24, max: 100, step: 1 }},
            ...cellTitleOps(),
            { type: Color, option: { label: '背景颜色', name: 'bgcolor', value: '#fff', showalpha: true }},
            ...imgOption(),
            { type: Link, option: { label: '详情地址', name: 'link' }}
          ]
        },
        ...DataOption()
      ]
    }
  }

}
